package com.zzy.app.test;

import com.zzy.app.config.MainConfigDI;
import com.zzy.app.config.prop.MainConfigProps;
import com.zzy.app.service.BookService;
import org.junit.jupiter.api.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.env.ConfigurableEnvironment;

import java.util.Map;

public class IOCTestDI {
    @SuppressWarnings("resource")
    @Test
    public void test1() {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigDI.class);

        Map<String, BookService> beansOfType = applicationContext.getBeansOfType(BookService.class);
        for (String s : beansOfType.keySet()) {
            System.out.println(beansOfType.get(s));
        }


    }
}
